"""
Setup script for CodeMCP framework.
"""

from setuptools import setup, find_packages
from pathlib import Path

# Read the README file
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding='utf-8') if (this_directory / "README.md").exists() else ""

# Read requirements
requirements = []
if (this_directory / "requirements.txt").exists():
    with open(this_directory / "requirements.txt") as f:
        requirements = [line.strip() for line in f if line.strip() and not line.startswith('#')]

setup(
    name="codemcp",
    version="1.0.0",
    author="CodeMCP Development Team",
    author_email="dev@codemcp.org",
    description="Universal Function Call Tree Analysis Framework",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/codemcp/codemcp",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Topic :: Software Development :: Code Generators",
        "Topic :: Software Development :: Debuggers",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    python_requires=">=3.8",
    install_requires=requirements,
    extras_require={
        "dev": [
            "black>=23.0.0",
            "flake8>=6.0.0", 
            "mypy>=1.5.0",
            "isort>=5.12.0",
            "pytest>=7.4.0",
            "pytest-asyncio>=0.21.0",
            "pytest-cov>=4.1.0",
        ],
        "redis": ["redis>=5.0.0"],
        "syntax-highlighting": ["pygments>=2.16.0"],
        "docs": [
            "sphinx>=7.0.0",
            "sphinx-rtd-theme>=1.3.0",
        ],
    },
    entry_points={
        "console_scripts": [
            "codemcp=codemcp.cli.main:main",
            "codemcp-server=codemcp.gateway.app:main",
        ],
    },
    include_package_data=True,
    package_data={
        "codemcp": [
            "config/*.toml",
            "templates/*.j2",
        ],
    },
    project_urls={
        "Bug Reports": "https://github.com/codemcp/codemcp/issues",
        "Source": "https://github.com/codemcp/codemcp",
        "Documentation": "https://codemcp.readthedocs.io/",
    },
)